package StudyCode.summary.zipfile;

import java.io.IOException;
import java.io.OutputStream;
import java.util.zip.GZIPInputStream;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class UnGzipGzippedInputStreamToOutputStream {
	public static void unGzip(GZIPInputStream gzippedInputStream,
	                          OutputStream ungzippedOutputStream) throws IOException {
		byte[] buffer = new byte[1024];
		int len = -1;
		while ((len = gzippedInputStream.read(buffer)) != -1) {
			ungzippedOutputStream.write(buffer, 0, len);
		}
	}
}
